import { createRouter, createWebHistory,createWebHashHistory } from 'vue-router'
import homeVue from '../views/HomeVue.vue'
import loginVue from '../views/login/LoginVue.vue'
import registerVue from "../views/login/RegisterVue.vue";
import repasswdVue from "../views/login/RepasswdVue.vue";

//站点公告
import noticeVue from "../views/notice/NoticeVue.vue";

//网课管理
import courselistVue from "../views/course/CourseList.vue";
import courseaddVue from "../views/course/CourseAdd.vue";

//打卡
import aiVue from "../views/clockin/AIVue.vue";
import catVue from "../views/clockin/CATVue.vue";

//跑步
import jingyuVue from "../views/jogging/JingyuVue.vue";
import leidianVue from "../views/jogging/LeidianVue.vue";
import panguVue from "../views/jogging/PanguVue.vue";

//充值
import onlineVue from "../views/charge/OnlineVue.vue";
import carminVue from "../views/charge/CarmineVue.vue";

//个人中心
import userVue from "../views/user/UserVue.vue";
import agentVue from "../views/user/AgentVue.vue";
import logVue from "../views/user/LogVue.vue";
import changepasswdVue from "../views/user/RepasswdVue.vue";

//对接说明
import documentVue from "../views/docking/DocumentVue.vue";
import priceVue from "../views/docking/PriceVue.vue";
import carmineVue from "@/views/charge/CarmineVue.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [

    //   路由重定向
    {
      path: '/',
      redirect: '/home',
    }, {
      path: '/home',
      name: 'home',
      component: homeVue,
      children: [
        {
          path: '/notice',
          name: 'notice',
          component: noticeVue,
        },
        {
          path: '/courselist',
          name: 'courselist',
          component: courselistVue,
        },
        {
          path: '/courseadd',
          name: 'courseadd',
          component: courseaddVue,
        },{
          path: '/ai',
          name: 'ai',
          component: aiVue,
        },{
          path: '/cat',
          name: 'cat',
          component: catVue,
        }, {
          path: '/jing',
          name: 'jing',
          component: jingyuVue,
        }, {
          path: '/lei',
          name: 'lei',
          component: leidianVue,
        },{
          path: '/pan',
          name: 'pan',
          component: panguVue,
        }, {
          path: '/online',
          name: 'online',
          component: onlineVue,
        },{
          path: '/carmine',
          name: 'carmine',
          component: carmineVue,
        },{
          path: '/user',
          name: 'user',
          component: userVue,
        },{
          path: '/agent',
          name: 'agent',
          component: agentVue,
        },{
          path: '/log',
          name: 'log',
          component: logVue,
        }, {
          path: '/changepasswd',
          name: 'changepasswd',
          component: changepasswdVue,
        },{
          path: '/document',
          name: 'document',
          component:documentVue,
        },{
          path: '/price',
          name: 'price',
          component:priceVue,
        }]
    },
    {//登录 注册 忘记密码界面
      path: '/login',
      name: 'login',
      component: loginVue,
    },{
      path: '/register',
      name: 'register',
      component: registerVue,
    },{
      path: '/repasswd',
      name: 'repasswd',
      component: repasswdVue,
      }
    ]
})

export default router
